using System;
using System.Collections.Generic;
using System.Text;
using CustomCMS.API.ObjectModel;

namespace CustomCMS.API.Persistance
{
	public enum ElementType
	{
		template,
		page,
		image,
		www,
        dir
	}

    public interface IPersistanceProvider
    {
        void SetTemplate(string templateId, string directoryId, string userId, string content, string comment, string title);

        string GetTemplatesTree();

        Template GetTemplate(string templateId, string directoryId);

		void CreateDirectory(ElementType type, string directoryId);

		void DeleteDirectory(ElementType type, string directoryId, string userId);

		string GetUsingPages(string templateId,string directoryId);

        string GetPagesTree();

        Page GetPage(string pageId,string directoryId, out List<string> missingTemplates);

        string GetVersions(string id, string directoryId, ElementType type);

        void SetPage(string pageId, string directoryId,string userId, string title, string comment, string content, string templateId, string sectionStates);

		void SetImage(System.IO.Stream file, string userId, string filename, string directoryId);

        void Delete(ElementType type, string elementId,string directoryId, string userId);

		void Lock(ElementType type, string elementId, string directoryId,string userId);

		void Unlock(ElementType type, string elementId, string directoryId,string userId);

		ElementInfo[] GetHistory(ElementType type, string elementId, string directoryId);

        string GeneratePage(string pageId, string directoryId);

		string GenerateRepository(string user, bool isLicensedToKill);

        void CreateRepository();

		bool IsActionAllowed(string action, string userId);

		void Authenticate(string userId, string password);

        void MoveElement(ElementType type, string elementId, string directoryId, string to, string userId);

        string GenerateRepositoryStatus();

        void KillGenerationLock();

        void SetSectionStates(string userId, string pageId, string path, string states);
    }
}
